// frontend/components/VirtualList.vue
export default {
  computed: {
    visibleItems() {
      const start = Math.floor(this.scrollPos / this.itemHeight);
      const end = start + this.visibleCount;
      return this.items.slice(start, end).map((item, index) => ({
        ...item,
        offset: (start + index) * this.itemHeight,
      }));
    }
  },
  methods: {
    onScroll(e) {
      this.scrollPos = e.target.scrollTop;
      requestAnimationFrame(this.updateVisible);
    }
  }
}